Option Explicit
Sub Q_Sample027()
    ']wޥζMicrosoft Internet Controls
    ']wޥζMicrosoft HTML Object Library
    Dim myIE      As InternetExplorer
    Dim myDoc     As MSHTML.HTMLDocument
    Dim myLnk     As MSHTML.HTMLAnchorElement
    Dim mySiteUrl As String
    mySiteUrl = "http://www.drmaster.com.tw/"	'NURL
    Dim i         As Long
    Set myIE = CreateObject("InternetExplorer.Application")
    With myIE
        .Navigate mySiteUrl
        .Visible = True
        Do While .Busy
        Loop
        Do Until .ReadyState = READYSTATE_COMPLETE
        Loop
        Set myDoc = .Document
    End With
    With myDoc
        If .frames.Length > 0 Then
            For i = 0 To .frames.Length - 1
                Debug.Print .frames(i).Document.Title
                For Each myLnk In .frames(i).Document.links
                    Debug.Print myLnk.href
                Next
            Next
        Else
            For Each myLnk In .links
                Debug.Print myLnk.href
            Next
        End If
    End With
    myIE.Quit
    Set myIE = Nothing						'
    Set myDoc = Nothing
End Sub
